﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>鼓励金明细</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
		<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
	</head>

	<body>
		{include file="public/header" /}
		<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 统计管理 <span class="c-gray en">&gt;</span> 明细查询
			<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
		</nav>

			<div class="index_content clearfix">

				<div class="right"><!--右侧内容-->

					<div class="indrig_con">
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->
							<form id="my_form" action="{:url('count/score_count')}" method="post">
							<div class="zizh_con_1">
								<div class="chax_rowbox clearfix">
									<div class="shxx_row clearfix">
							            <div class="left">用户类型：</div>
							            <div class="right clearfix">
											<div id="htselect">
												<select name="type" id="type">
													<option value="">全部</option>
													<option {if $type==8}selected="selected"{/if} value="8">会员</option>
													<option {if $type==5}selected="selected"{/if} value="5">商家</option>
													<option {if $type==9}selected="selected"{/if} value="9">代理 </option>
												</select>
											</div>
							            </div>
							        </div>
							        <div class="shxx_row chax_row clearfix">
							            <div class="left">手机号码：</div>
							            <div class="right clearfix">
							                <input id="mobile" type="text" {if isset($mobile)} value="{$mobile}" {/if}  name="mobile"  placeholder="输入手机号" class="chax_input" />
						          	 	</div>
					      		 	 </div>
					      		 	<div class="shxx_row chax_row clearfix">
						            <div class="left">交易时间：</div>
						            <div class="right clearfix">
						                <div class="layui-inline">
									      <div class="layui-input-inline">
									        <input id="begin_time" type="text" {if isset($begin_time)} value="{$begin_time}" {/if} class="layui-input" name="begin_time" id="begin_time" placeholder="yyyy年MM月dd日">
									      </div>
									    </div>
						                <i class="chax_line"></i>
						                <div class="layui-inline">
									      <div class="layui-input-inline">
									        <input id="end_time" type="text" {if isset($end_time)} value="{$end_time}" {/if} class="layui-input" name="end_time"  id="end_time" placeholder="yyyy年MM月dd日">
									      </div>
									    </div>
						            </div>
						        </div>
						     
								</div>
								<div class="chax_rowbox clearfix">
							        <button type="submit" onclick="return check_time()" class="htcxbtn">搜索</button>
								</div>
								</form>
								<div class="chax_conbox">
									<div class="chax_jiegbt clearfix">
										<div class="chax_jieg">累计充值({$sums})</div>
										<div class="chax_xzbtnbox">
											<a href="#" onclick="check()"><i class="iconfont icon-daochu"></i>导出</a>
										</div>
									</div>
									<div class="chax_jiegnr">
										<table class="zizh_table1">
											<thead>
												<tr>
													<th class="w_15">订单号</th>													
													<th class="w_20">用户类型</th>
													<th>名称</th>
													<th>电话号码</th>
													<th class="w_10">描述</th>
													<th class="w_10">支付方式</th>
													<th class="w_10">金额</th>
													<th class="w_15">日期</th>
												</tr>
											</thead>
											<tbody id="tbody">
												{volist name="list" id="vo"}
												<tr>
													<td>{$vo.order_sn}</td>	
													<td>
														{if $vo['order_type']==8}
														会员
														{elseif $vo['order_type']==5}
														商家
														{elseif $vo['order_type']==9}
														服务商
														{/if}
													</td>
													<td>
														{if $vo['order_type']==8}
														{$vo['user_name']}
														{elseif $vo['order_type']==5}
														{$vo['agent_name']}
														{elseif $vo['order_type']==9}
														服务商
														{/if}
													</td>
													<td>
														{if $vo['order_type']==8}
														{$vo['mobile2']}
														{elseif $vo['order_type']==5}
														{$vo['mobile3']}
														{elseif $vo['mobile']==9}
														服务商
														{/if}
													</td>
													<td>
													{$vo.message}
													</td>
													<td>
													{switch name="$vo.pay_type"}
													    {case value="1"}余额{/case}
													    {case value="2"}微信{/case}
													    {case value="3"}支付宝{/case}
													    {default /}银联
													{/switch}
													</td>
													<td>{$vo['balance']}</td>
													<td>{$vo.add_time}</td>
												</tr>
												{/volist}
											</tbody>
										</table>
										<div class="fenye" style="display: block;">
											{$list->render()}
										</div>
		
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>

		{include file="public/footer" /}
		
	</body>

</html>
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
<script type="text/javascript">
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
	})
	
	//切换OEM
	function oem_change(id){
		 $.ajax({
             	type:"post",
                url:"{:url('count/sdname')}",
                data: {
                	id:id
                },
                success:function(data){  
                	var sdlist = data.data;
                    var select_htm = '';
					if(sdlist && sdlist.length<1){
						select_htm = "<option value=''>全部</option>";
					}else{
						select_htm = "<option value=''>全部</option>";
						for(var i=0;i<sdlist.length;i++){
							select_htm += "<option value='"+sdlist[i].id+"'>"+sdlist[i].user_name+"</option>";
						}
					}

					$('#sdname').empty();
					$('#sdname').append(select_htm);

                },error:function(data){
                	var a = data;
                }
        });
	}
	
	
	//切换省代
	function sheng_change(id){
		 $.ajax({
             	type:"post",
                url:"{:url('count/sdlist')}",
                data: {
                	id:id
                },
                success:function(data){  
                	var sdlist = data.data;
                    var select_htm = '';
					if(sdlist && sdlist.length<1){
						select_htm = "<option value=''>全部</option>";
					}else{
						select_htm = "<option value=''>全部</option>";
						for(var i=0;i<sdlist.length;i++){
							select_htm += "<option value='"+sdlist[i].id+"'>"+sdlist[i].user_name+"</option>";
						}
					}

					$('#sdlist').empty();
					$('#sdlist').append(select_htm);

                },error:function(data){
                	var a = data;
                }
        });
	}
	
	
	//切换市代
	function sd_change(id){
		 $.ajax({
             	type:"post",
                url:"{:url('count/ywylist')}",
                data: {
                	id:id
                },
                success:function(data){  
                	var ywylist = data.data;
                    var select_htm = '';
					if(ywylist && ywylist.length<1){
						select_htm = "<option value=''>全部</option>";
					}else{
						select_htm = "<option value=''>全部</option>";
						for(var i=0;i<ywylist.length;i++){
							select_htm += "<option value='"+ywylist[i].id+"'>"+ywylist[i].name+"</option>";
						}
					}
					console.log(select_htm);
					$('#ywylist').empty();
					$('#ywylist').append(select_htm);
					
					var dplist = data.datas;
                    var select_htms = '';
					if(dplist && dplist.length<1){
						select_htms = "<option value=''>全部</option>";
					}else{
						select_htms = "<option value=''>全部</option>";
						for(var i=0;i<dplist.length;i++){
							select_htms += "<option value='"+dplist[i].id+"'>"+dplist[i].agent_name+"</option>";
						}
					}
					
					$('#dplist').empty();
					$('#dplist').append(select_htms);

                },error:function(data){
                	var a = data;
                }
        });
	}
	
	//切换店铺
	function store_change(id){
		 $.ajax({
             	type:"post",
                url:"{:url('count/storelist')}",
                data: {
                	id:id
                },
                success:function(data){  
                	var storelist = data.data;
                    var select_htm = '';
					if(storelist && storelist.length<1){
						select_htm = "<option value=''>全部</option>";
					}else{
						select_htm = "<option value=''>全部</option>";
						for(var i=0;i<storelist.length;i++){							
							select_htm += "<option value='"+storelist[i].id+"'>"+storelist[i].store_name+"</option>";
						}
					}
					$('#storelist').empty();
					$('#storelist').append(select_htm);

                },error:function(data){
                	var a = data;
                }
        });
	}
	
	function check() {	
		var type = $('#type').val();
		var mobile = $('#mobile').val();
		var begin_time = $('#begin_time').val();
		var end_time = $('#end_time').val();

		window.location.href = "/admin/count/score_dc.html?type=" + type + "&mobile=" + mobile + "&begin_time=" + begin_time + "&end_time=" + end_time
		
	}
</script>